<!--  -->
<template>
  <div class>
    <div class="toP">
      <p class="toP-p">角色管理</p>
    </div>
    <div class="forM">
      <div class="forM-fm">
        <p class="forM-p1">
          <i class="el-icon-menu"></i>筛选
        </p>
        <div class="forM-el">
          <span>输入搜索：</span>
          <input type="text" class="forM-el-inp" placeholder="请输入员工" />
          <el-button
            type="primary"
            icon="el-icon-s-check"
            style="width: 100px;height: 40px;margin-left: 30px; background: #9137f3;"
            @click="lookup"
          >筛选</el-button>
          <span class="forM-el-inps" @click="empty">清空筛选条件</span>
        </div>
      </div>
    </div>
    <!--结束-->
    <div class="warp">
      <div class="warp-box">
        <p class="warp-p">
          <i class="el-icon-s-fold"></i>角色管理
        </p>
        <div class="warp-div">
          <span>工号</span>
          <span>姓名</span>
          <span>会员手机</span>
          <span>角色</span>
          <span>添加时间</span>
        </div>
        <div id="inps">
          <div>
            <el-table :data="tableData" style="width: 100%;font-size: 12px;">
              <el-table-column prop="date" width="220"></el-table-column>
              <el-table-column prop="name" width="220"></el-table-column>
              <el-table-column prop="address" width="250"></el-table-column>
              <el-table-column prop="mini" width="200"></el-table-column>
              <el-table-column prop="place" width="130"></el-table-column>
            </el-table>
          </div>
        </div>
        <div class="wrap-box-paging">
          <div class="wrap-box-pagingS">
            <el-pagination background layout="prev, pager, next" :total="100" style="color:red"></el-pagination>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    //这里存放数据
    return {
      tableData: [
        {
          date: "1001",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1002",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1003",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1004",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1005",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1006",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1007",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1008",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
         {
          date: "1009",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
      ],
      abc: [
       {
          date: "1001",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1002",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1003",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1004",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1005",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1006",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1007",
          name: "john",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
        {
          date: "1008",
          name: "admin",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
         {
          date: "1009",
          name: "daisy",
          address: "18312312301",
          mini: "管理员",
          place: "2019-01-25 10:55",
        },
      ],
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {
    empty: function () {
      let inp = document.getElementsByClassName("forM-el-inp")[0];
      inp.value = "";
      this.tableData = this.abc;
    },
    lookup: function () {
      this.tableData = this.abc;
      let inpdata = [];
      let inp = document.getElementsByClassName("forM-el-inp")[0];
      for (let j = 0; j < this.tableData.length; j++) {
        if (inp.value.trim() === this.tableData[j].name) {
          inpdata.push(this.tableData[j]);
        }
      }
      this.tableData = inpdata;
    },
  },
};
</script>
<style  scoped>
* {
  margin: 0;
  padding: 0;
}
html {
  width: 100%;
  height: 100%;
}
.toP {
  width: 100%;
  height: 70px;
}
.toP-p {
  margin: auto;
  line-height: 70px;
  font-family: "思源黑体 Bold", "思源黑体";
  font-weight: 700;
  font-style: normal;
  font-size: 24px;
  margin-left: 25px;
  color: #9137f3;
}
.forM {
  width: 100%;
}
.forM-fm {
  margin: auto;
  width: 1100px;
  height: 134px;
  padding-top: 15px;
  padding-left: 15px;
  padding-right: 0px;
  border: 1px solid rgb(228, 228, 228);
  border-radius: 1px;
  color: black;
}
.forM-p1 {
  color: rgb(153, 153, 153);
  font-size: 15px;
}
.forM-el-inp {
  width: 170px;
  height: 35px;
  border: 1px solid rgb(228, 228, 228);
  padding: 10px;
}
.forM-el {
  font-size: 14px;
  margin-top: 35px;
}
.forM-el-inp {
  width: 170px;
  height: 35px;
  border: 1px solid rgb(228, 228, 228);
  padding: 10px;
}
.forM-el-XiaDan {
  margin-left: 40px;
  margin-right: 40px;
}
.forM-el-inps {
  font-size: 12px;
  margin-left: 10px;
  color: #9137f3;
}
.warp {
  width: 100%;
}
.warp-box {
  width: 1100px;
  height: 100%;
  margin: auto;
  margin-top: 20px;
  border: 1px solid rgb(228, 228, 228);
  padding: 30px;
}
.warp-div {
  width: 1042px;
  height: 60px;
  margin-top: 30px;
  text-align: center;
  line-height: 60px;
  background: #9137f3;
  text-align: center;
}
.warp-div span {
  font-size: 14px;
  float: left;
  display: block;
  margin-left: 190px;
  font-weight: bold;
  text-align: center;
  color: #ffffff;
}
.warp-div span:nth-child(1) {
  margin-left: 20px;
}
.wrap-box-paging {
  height: 100px;
}
.wrap-box-pagingS {
  float: right;
  margin-top: 50px;
}
</style>